﻿using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Text;

namespace Entity
{
   public class Advertise
    {
       public string Id { get; set; }
       public string Name { get; set; }
       public string Image { get; set; }
       public string Width { get; set; }
       public string Height { get; set; }
       public string Link { get; set; }
       public string Target { get; set; }
       public string Content { get; set; }
       public string Position { get; set; }
       public string PageId { get; set; }
       public string Click { get; set; }
       public string Ord { get; set; }
       public string Active { get; set; }
       public string Lang { get; set; }
       public static Advertise AdvertiseIDataReader(IDataReader dr)
       {
           var obj = new Advertise
                         {
                             //(dr["Id"] is DBNull) ? string.Empty : dr["Id"].ToString(),
                             Name = Convert.ToString(dr["Name"]),
                             Image = Convert.ToString(dr["Image"]),
                             Width = Convert.ToString(dr["Width"]),
                             Height = Convert.ToString(dr["Height"]),
                             Link = Convert.ToString(dr["Link"]),
                             Target = Convert.ToString(dr["Target"]),
                             Content = Convert.ToString(dr["Content"]),
                             Position = Convert.ToString(dr["Position"]),
                             PageId = Convert.ToString(dr["PageId"]),
                             Click = Convert.ToString(dr["Click"]),
                             Ord = Convert.ToString(dr["Ord"]),
                             Active = Convert.ToString(dr["Active"]),
                             Lang = Convert.ToString(dr["Lang"]),
                             Id = Convert.ToString(dr["Id"])
                         };
           return obj;
       }
    }
}
